<template>
	<view class="index">
		<sdc-navbar title="商品分类" :isBack="false"></sdc-navbar>
		<s-tab @change="change" ref='tab'></s-tab>
		<s-products ref="products"></s-products>
		<sdc-cart></sdc-cart>
		<sdc-tabbar></sdc-tabbar>
	</view>
</template>

<script>
	import STab from './components/index/s-tab.vue'
	import SProducts from './components/index/s-products.vue'
	export default {
		data() {
			return {
				
			};
		},
		components: {
			STab,
			SProducts
		},
		methods: {
			change({item}){
				this.$refs.products.reload(item)
			}
		},
		onReady() {
			let defaultItem = this.$refs.tab.productCategory[0]
			this.$refs.products.reload(defaultItem)
		},
		onReachBottom() {
			this.$refs.products.nextPage()
		}
	}
</script>

<style lang="scss">

</style>
